import time
from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.maximize_window()
driver.get("https://sahitest.com/demo/promptTest.htm")
time.sleep(2)
driver.find_element(By.NAME, 'b1').click()
time.sleep(2)
# 输入内容 但并不显示
driver.switch_to.alert.send_keys("输入的文字")
time.sleep(2)
# 点击确定弹窗
driver.switch_to.alert.accept()
time.sleep(3)
driver.close()
